#!perl
# Copyright (C) 2001-2008, The Perl Foundation.

use strict;
use warnings;
use lib qw( lib );

# need runtests from T::H, but avoid running all our parrot invocations with -w
use Test::Harness ();
undef $Test::Harness::Switches;

my @tests = map { glob($_) } qw{t/*.t t/internals/*.t};

my $harness;
eval { require TAP::Harness };
if ($@) {
    Test::Harness::runtests(@tests);
    exit;
}
else {
    $harness = TAP::Harness->new({
        verbosity => $ENV{HARNESS_VERBOSE},
        merge     => 0,
        jobs      => $ENV{TEST_JOBS} || 1,
        directives => 1,
    });
}
my $results = $harness->runtests(@tests);

# a non-zero code stops make after test failures (RT #60116)
exit ( $results->all_passed() ? 0 : 1 );

=head1 NAME

t/harness - partcl Test Harness

=head1 NOTES

Borrowed from parrot's t/harness to get TEST_JOBS working.

=cut
